<template>
	<view>
		<view class="content" v-if="info">
			<u-swiper :list="info.images" v-if="info.images && info.images.length" height="630"></u-swiper>
			<image class="cover" :src="info.cover" mode="widthFix" v-else></image>
			<view class="info">
				<view class="title">{{info.goodsName}}</view>
				<view class="price">{{info.price}} i币</view>
				<view class="remark">
					<jyf-parser :html="info.detail"></jyf-parser>
				</view>
			</view>
		</view>
		
		
		<view class="safe-area-inset-bottom" style="height: 120rpx;box-sizing: content-box;"></view>
		
		<view class="next safe-area-inset-bottom u-flex">
			<view @click="jump(`/pages/college/goods-submit?id=${goods_id}`)">立即购买</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				goods_id:'',
				info:''
			}
		},
		methods: {
			getGoodsInfo(){
				this.$u.api.goodsDetail({goods_id:this.goods_id}).then(res=>{
					this.info = res
				})
			}
		},
		onLoad(o) {
			this.goods_id = o.id
			this.getGoodsInfo()
		}
	}
</script>

<style lang="scss">
	.content{
		padding: 0 60rpx;
		.cover{width: 100%;display: block;height: 360rpx;border-radius: 30rpx;}
		.info{
			padding-top: 40rpx;
			.title{font-weight: bold;}
			.price{color: #F55332FF;padding-top: 10rpx;}
			.remark{padding-top: 30rpx;padding-bottom: 30rpx;}
		}
	}
	
	.next{position: fixed;left: 0;height: 119rpx;bottom: 0rpx;background-color: #fff;width: 100%;
		z-index: 99;box-sizing: content-box;border-top: 1rpx solid #ddd;justify-content: center;
		view{background: linear-gradient(90deg, #FAE273 0%, #F4D039 100%);color: #fff;text-align: center;width: 88%;line-height: 70rpx;font-weight: bold;border-radius: 100rpx;}
	}
</style>
